package org.come.control;

import java.math.BigDecimal;

import org.come.Frame.RewardHallJframe;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.RewardHallJpanel;
import org.come.action.NpcMenuAction;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.FormsManagement;

import com.tool.role.RoleData;

public class GangOperationControl implements NpcMenuAction {

	@Override
	public void menuControl(String type) {

		if ("我要抽奖".equals(type)) {
			ZhuFrame.getZhuJpanel().addPrompt2("还未开放");
			if ("我要抽奖".equals(type)) {
				return;
			}
			// 向服务器请求获得物品集合
			String senmes = null;
			try {
				senmes = Agreement.getAgreement().obtainarticleAgreement();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			SendMessageUntil.toServer(senmes);
			BigDecimal decimal = RoleData.getRoleData().getLoginResult().getScoretype("帮派积分");
			RewardHallJpanel jpane = RewardHallJframe.getRewardHallJframe().getRewardHallJpanel();
			jpane.setTotalsum(decimal);
			jpane.setLotteryNum(new BigDecimal(decimal.divide(jpane.getUnitprice()).intValue()));
			FormsManagement.showForm(59);
		} else if ("我要投放功绩物品".equals(type)) {
			ZhuFrame.getZhuJpanel().addPrompt2("还未开放");
//			GiveJpanel givejpanel = GiveJframe.getGivejframe().getGivejpanel();
//			// 设置界面上的变化
//			givejpanel.getLabplayer().setText("");
//			givejpanel.getLabplyername().setText("");
//			givejpanel.getTextNumber().setText("1");
//			// 设置不可编辑
//			givejpanel.getTextNumber().setEditable(false);
//			givejpanel.getTextMoney().setEditable(false);
//			GiveJframe.getGivejframe().getGivejpanel().getBtnGive().setText("投放");
//			FormsManagement.showForm(12);
		}

	}

}
